{% extends 'base.html' %}

{% block title %}NLP 分析{% endblock %}

{% block content %}
    <style>
        /* 复用 index.html 的样式变量 */
        :root {
            --primary-blue: #524eef;
            --text-gray: #6D6D6D;
            --accent-yellow: #FFF8E5;
            --accent-purple: #E8E6F9;
        }

        body {
            background: -webkit-linear-gradient(top,
                    #ffffff 0%,
                    #fffede 33%,
                    #cdccff 66%,
                    #524eef 100%);
            background: linear-gradient(to bottom,
                    #ffffff 0%,
                    #fffede 33%,
                    #cdccff 66%,
                    #524eef 100%);
            min-height: 100vh;
            padding-bottom: 12%;
        }

        .nlp-search-container {
            position: relative;
            width: 60%;
            margin: 100px auto 0;
        }

        .nlp-search-input {
            width: 100%;
            padding: 18px 60px 18px 30px;
            border: 2px solid var(--primary-blue);
            border-radius: 50px;
            font-size: 16px;
            color: var(--text-gray);
            background: rgba(255, 255, 255, 0.9);
        }

        .nlp-button-group {
            margin-top: 20px;
            display: flex;
            flex-wrap: wrap;
            gap: 10px;
            justify-content: center;
        }

        .nlp-btn {
            background: var(--primary-blue);
            color: white;
            border: none;
            border-radius: 20px;
            padding: 8px 25px;
            font-size: 16px;
            white-space: nowrap;
            cursor: pointer;
            transition: opacity 0.3s;
        }

        .nlp-btn:hover {
            opacity: 0.9;
        }
    </style>

    <div class="nlp-search-container">
        <h1 class="text-center mb-4" style="color: var(--primary-blue);">NLP 分析</h1>
        <form action="/nlp/" method="get">
            <textarea name="text" rows="5" class="nlp-search-input" placeholder="输入文本分析NLP"></textarea>
            <div class="nlp-button-group">
                <button type="submit" name="analysis_type" value="all" class="nlp-btn">全部分析</button>
                <button type="submit" name="analysis_type" value="tokenize" class="nlp-btn">分词</button>
                <button type="submit" name="analysis_type" value="pos" class="nlp-btn">词性标注</button>
                <button type="submit" name="analysis_type" value="srl" class="nlp-btn">语义角色分析</button>
                <button type="submit" name="analysis_type" value="ner" class="nlp-btn">专名识别</button>
                <button type="submit" name="analysis_type" value="coref" class="nlp-btn">指代消解</button>
                <button type="submit" name="analysis_type" value="con" class="nlp-btn">成分句法分析</button>
                <button type="submit" name="analysis_type" value="tokenize_search" class="nlp-btn">分词搜索</button>
            </div>
        </form>
    </div>
{% endblock %}